home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / TEST / EDIT_TES.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  2.6 KB  |  83 lines

  1. /*
  2.  * $Id: edit_test.java,v 1.10 1996/10/03 19:46:51 hudson Exp $
  3.  * $Author: hudson $
  4.  */
  5.  
  6. package sub_arctic.test;
  7.  
  8. import sub_arctic.input.callback_object;
  9. import sub_arctic.input.event;
  10. import sub_arctic.lib.interactor_applet;
  11. import sub_arctic.lib.manager;
  12. import sub_arctic.lib.interactor;
  13. import sub_arctic.lib.button;
  14. import sub_arctic.lib.interactor_consts;
  15. import sub_arctic.lib.top_level;
  16. import sub_arctic.lib.oneline_text_edit;
  17. import sub_arctic.lib.text_edit;
  18. import sub_arctic.lib.base_parent_interactor;
  19. import sub_arctic.lib.scale;
  20. import sub_arctic.constraints.std_function;
  21.  
  22. public class edit_test extends interactor_applet implements interactor_consts, callback_object {
  23.   
  24.   oneline_text_edit oneline;
  25.  
  26.   public void callback(
  27.     interactor       from_obj, 
  28.     event            evt,
  29.     int              callback_num, 
  30.     Object           callback_info) {
  31.     if (from_obj instanceof button)
  32.       oneline.set_text(null);
  33.   }
  34.  
  35.   public void build_ui(base_parent_interactor top)
  36.     {
  37.       button clear;
  38.       text_edit txt = new text_edit(100,10, 600,400, 
  39.                     "this is a test, line 1\n" +
  40.                     "this is a test, line 2\n" +
  41.                     "this is a test, longer line 3\n" +
  42.                     "this is a test, longer line 4\n" +
  43.                     "this is a test, longer line 5\n"+
  44.                     "\n\n"+
  45.                     "a final line.", null, false);
  46.       txt.set_selection(0,2, text_edit.SELECT_END,10);
  47.       txt.set_h_spacing(10);
  48.       txt.set_v_spacing(20);
  49.       txt.size_by_content();
  50.       txt.set_part_a_constraint(std_function.eq(NEXT_SIBLING.PART_A()));
  51.  
  52.       scale s1 = new scale(150, 0, 30, 0, 10, this);
  53.       s1.set_x_constraint(std_function.eq(PREV_SIBLING.X()));
  54.       s1.set_y_constraint(std_function.offset(PREV_SIBLING.Y2(),5));
  55.  
  56.       oneline=new oneline_text_edit(10,320,"Testing this interactor",
  57.                     null,false);
  58.  
  59.       top.add_child(txt);
  60.       top.add_child(s1);
  61.       top.add_child(oneline);
  62.       clear=new button(180,320,"Clear Text Field", this);
  63.       top.add_child(clear);
  64.     }
  65. }
  66.  
  67. /*=========================== COPYRIGHT NOTICE ===========================
  68.  
  69. This file is part of the subArctic user interface toolkit.
  70.  
  71. Copyright (c) 1996 Scott Hudson and Ian Smith
  72. All rights reserved.
  73.  
  74. The subArctic system is freely available for most uses under the terms
  75. and conditions described in 
  76.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  77. and appearing in full in the lib/interactor.java source file.
  78.  
  79. The current release and additional information about this software can be 
  80. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  81.  
  82. ========================================================================*/
  83.